#ifndef GRAMMAR_H
#define GRAMMAR_H
#include"GrammarSymbol.h"
#include<iostream>
#include<fstream>
#include<sstream>
#include<time.h>
#include<stdlib.h>
#include<assert.h>
class Grammar{
  private:
    int Grammar_Num,Token_Num;
    GrammarSymbol *gs;
  public:
    inline int grammar_num(){return Grammar_Num;}
    inline int token_num(){return Token_Num;}
    void readfromfile(std::string filename);
    void writetofile(std::string filename);
    void initialize(int g_num,int t_num);
    
    inline GrammarSymbol& getGrammarSymbol(int gid){
      assert(gid<Grammar_Num);
      return gs[gid];
    }
};
#endif
